<?php
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/10/19 14:20
 * Desc: 组合产品
 */
class Request_Api_V2_Combination extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function query()
    {
        $this->rules = [
            ['sort', ['digit']],
            ['dest_id', ['digit', $this->rule_min(0)]],
            ['price_id', ['digit', $this->rule_min(0)]],
            ['page', ['digit', $this->rule_min(1)]],
            ['pagesize', ['digit', $this->rule_min(1)]],
        ];

        return $this;
    }

    public function get_detail()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]]
        ];

        return $this;
    }

    public function get_suit()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]]
        ];

        return $this;
    }

    public function get_contract()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]]
        ];

        return $this;
    }

    public function calendar_price()
    {
        $this->rules = [
            ['combination_product_id', ['not_empty','digit', $this->rule_min(1)]],
            ['suit_id', ['not_empty','digit', $this->rule_min(1)]],
            ['type_id', ['not_empty','digit', $this->rule_min(1)]]
        ];

        return $this;
    }

    public function add_order()
    {
        $this->rules = [
            ['source', ['not_empty','digit']],
            ['combination_id', ['not_empty','digit', $this->rule_min(1)]],
            ['link_name', ['not_empty']],
            ['link_tel', ['not_empty', 'phone']],
            ['link_email', ['email']],
        ];

        return $this;
    }

    public function order_detail()
    {
        $this->rules = [
            ['id', ['not_empty','digit', $this->rule_min(1)]]
        ];

        return $this;
    }


}